<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:tiles="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org" lang="en">

<head>

<title>SEG</title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<meta name="author" content="" />

<link href="../../static/bootstrap/css/bootstrap.min.css" th:href="@{/static/bootstrap/css/bootstrap.min.css}" rel="stylesheet" />
<script src="../../static/bootstrap/js/bootstrap.min.js" th:src="@{/static/bootstrap/js/bootstrap.min.js}"></script>
<link href="../../static/font-awesome/css/font-awesome.min.css" th:href="@{/static/font-awesome/css/font-awesome.min.css}" rel="stylesheet" />
<script src="../../static/jquery/jquery.min.js" th:src="@{/static/jquery/jquery.min.js}"></script>

<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" th:href="@{'http://fonts.googleapis.com/css?family=Open+Sans:400,300'}" rel="stylesheet" />

<link href="../../static/custom/ace.min.css" th:href="@{/static/custom/ace.min.css}" rel="stylesheet" />
<link href="../../static/ace-rtl.min.css" th:href="@{/static/custom/ace-rtl.min.css}" rel="stylesheet" />

</head>

<body class="login-layout">

	<div xmlns:th="http://www.thymeleaf.org"
		th:with="lastUsernameKey=${T(org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter).SPRING_SECURITY_LAST_USERNAME_KEY},
              lastExceptionKey=${T(org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter).SPRING_SECURITY_LAST_EXCEPTION_KEY}">
		<div class="main-container">
			<div class="main-content">
				<div class="row">
					<div class="col-sm-10 col-sm-offset-1">
						<div class="login-container">
							<div class="center">
								<h1>
									<i class="fa fa-road green"></i> <span class="red">S</span>
									<span class="white">EG</span>
								</h1>
								<h4 class="blue">&copy; Essalud</h4>
								<div class="alert alert-danger" th:if="${param.login_error}">
									<strong>Ingreso no exitoso, intenta nuevamente.</strong> <br />
									<span th:if="${session} and ${session[__${lastExceptionKey}__]}">
										<span> Motivo:</span>
										<span th:text="${session[__${lastExceptionKey}__].message}">Contraseña invalida</span>
									</span>
								</div>
							</div>
							<div class="space-6"></div>
							<div class="position-relative">
								<div id="login-box"
									class="login-box visible widget-box no-border">
									<div class="widget-body">
										<div class="widget-main">
											<h4 class="header blue lighter bigger">
												<i class="fa fa-coffee green"></i> Datos de acceso
											</h4>
											<div class="space-6"></div>
											<form action="#" th:action="@{/loginProcess}" method="post">
												<fieldset>
													<label class="block clearfix"> 
													<span class="block input-icon input-icon-right"> 
														<input type="text" class="form-control" name="username" id="username" placeholder="Nombre de usuario" th:value="(${param.login_error} and ${session}) ? ${session[__${lastUsernameKey}__]} : ''"/>
														<i class="ace-icon fa fa-user"></i>
													</span>
													</label> 
													<label class="block clearfix">
													<span class="block input-icon input-icon-right">
														<input type="password" class="form-control"	name="password" id="password" placeholder="Contrase&ntilde;a" /> 
														<i class="ace-icon fa fa-lock"></i>
													</span>
													</label>
													<div class="space"></div>

													<div class="clearfix">
														<button type="submit"
															class="width-35 pull-right btn btn-sm btn-primary">
															<i class="fa fa-key"></i> Ingresar
														</button>
													</div>
													<div class="space-4"></div>
												</fieldset>
											</form>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
